package com.tancire.question.service.impl;

import java.util.List;
import javax.annotation.Resource;
import com.tancire.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.tancire.question.mapper.QuestionMapper;
import com.tancire.question.domain.Question;
import com.tancire.question.service.IQuestionService;

/**
 * 面试题管理Service业务层处理
 *
 * @author chenchao
 * @date 2024-06-06
 */
@Service
public class QuestionServiceImpl implements IQuestionService {
    @Resource
    private QuestionMapper questionMapper;

    /**
     * 查询面试题管理
     *
     * @param questionId 面试题管理主键
     * @return 面试题管理
     */
    @Override
    public Question selectQuestionByQuestionId(Long questionId) {
        return questionMapper.selectQuestionByQuestionId(questionId);
    }

    /**
     * 查询面试题管理列表
     *
     * @param question 面试题管理
     * @return 面试题管理
     */
    @Override
    public List<Question> selectQuestionList(Question question) {
        return questionMapper.selectQuestionList(question);
    }

    /**
     * 新增面试题管理
     *
     * @param question 面试题管理
     * @return 结果
     */
    @Override
    public int insertQuestion(Question question) {
        question.setCreateTime(DateUtils.getNowDate());
        return questionMapper.insertQuestion(question);
    }

    /**
     * 修改面试题管理
     *
     * @param question 面试题管理
     * @return 结果
     */
    @Override
    public int updateQuestion(Question question) {
        question.setUpdateTime(DateUtils.getNowDate());
        return questionMapper.updateQuestion(question);
    }

    /**
     * 批量删除面试题管理
     *
     * @param questionIds 需要删除的面试题管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionByQuestionIds(Long[] questionIds) {
        return questionMapper.deleteQuestionByQuestionIds(questionIds);
    }

    /**
     * 删除面试题管理信息
     *
     * @param questionId 面试题管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionByQuestionId(Long questionId) {
        return questionMapper.deleteQuestionByQuestionId(questionId);
    }
}
